package com.grieous.wow.entity;

import java.io.Serializable;
import java.util.Date;

import com.grieous.wow.common.DateUtil;

public class Article implements Serializable{
	
	private static final long serialVersionUID = 1L;

	private Long id;

    private String title;

    private String author;

    private Integer views;

    private Date createTime;

    private Date modifyTime;

    private String detail;
    
    private Integer category;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Integer getViews() {
        return views;
    }

    public void setViews(Integer views) {
        this.views = views;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }
    public String getCreateTimeStr() {
		return DateUtil.getDateStr("yyyy-MM-dd HH:mm", createTime);
	}
    public String getCreateTimeMonStr() {
		return DateUtil.getDateStr("MM-dd", createTime);
	}
    
	public Integer getCategory() {
		return category;
	}
	
	public void setCategory(Integer category) {
		this.category = category;
	}
	public String getCategoryName() {
		if(category==1){
			return "魔兽世界私服信息";
		}else if(category==2){
			return "魔兽私服相关信息";
		}else if(category==3){
			return "魔兽世界相关信息";
		}else{
			return "无";
		}
	}
	public String getTitle15() {
		if (title != null && !title.equals("") && title.length() > 15) {
			return title.substring(0, 15);
		}
		return title;
	}

	public Article() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Article(String title, String author, Integer views, Date createTime,
			Date modifyTime, String detail, Integer category) {
		super();
		this.title = title;
		this.author = author;
		this.views = views;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
		this.detail = detail;
		this.category = category;
	}
	
}